package com.yanqu.road.server.timer.stronghold;

import com.yanqu.road.server.manager.strongholdwar.CrossStrongholdMgr;
import com.yanqu.road.utils.executor.GeneralTask;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

public class StrongholdRefreshBoxTask extends GeneralTask {
    private static final Logger LOGGER = LogManager.getLogger(StrongholdRefreshBoxTask.class);
    private boolean isRun;

    @Override
    public void doRun() {
        if (isRun) {
            return;
        }
        isRun = true;
        try {
            CrossStrongholdMgr.refreshBox();
            CrossStrongholdMgr.resetUnionScore();
        } catch (Exception e) {
            LOGGER.error("refresh stronghold box error.", e);
        }
        isRun = false;
    }
}
